import request from '@/utils/request'

// 查询商户信息列表
export function listMch(query) {
  return request({
    url: '/mch/list',
    method: 'get',
    params: query
  })
}

// 查询商户信息详细
export function getMch(mchNo) {
  return request({
    url: '/mch/' + mchNo,
    method: 'get'
  })
}
export function getMchConfig(mchNo) {
  return request({
    url: '/mch/config/' + mchNo,
    method: 'get'
  })
}
export function updateMchConfig(data) {
  return request({
    url: '/mch/config',
    method: 'post',
    data: data
  })
}
export function updateUserPayPwd(data) {
  return request({
    url: '/mch/updateUserPayPwd',
    method: 'post',
    data: data
  })
}

// 新增商户信息
export function addMch(data) {
  return request({
    url: '/mch',
    method: 'post',
    data: data
  })
}
export function mchPayIfList(query) {
  return request({
    url: '/mch/mchPayIfList',
    method: 'get',
    params: query
  })
}
export function updateMchPayIf(data) {
  return request({
    url: '/mch/payIf',
    method: 'post',
    data: data
  })
}
export function deleteMchPayIf(id) {
  return request({
    url: '/mch/payIf/' + id,
    method: 'delete',
  })
}
export function resetMchGoogle(id) {
  return request({
    url: '/mch/resetGoogle/' + id,
    method: 'delete',
  })
}
// 修改商户信息
export function updateMch(data) {
  return request({
    url: '/mch',
    method: 'put',
    data: data
  })
}

// 删除商户信息
export function delMch(mchNo) {
  return request({
    url: '/mch/' + mchNo,
    method: 'delete'
  })
}
